package 曾世昌12_8.zuoye9;

import java.lang.reflect.Field;

public class test {
    public static void main(String[] args) throws Exception {
        Class<?> aClass = Class.forName( "rc.mxdx3_zhoumozuoye.zuoye9.Student" );
        Object o = aClass.getDeclaredConstructor().newInstance();
        Field name = aClass.getDeclaredField( "name" );
        name.setAccessible( true );
        name.set( o, "小虎" );
        Object o2 = name.get( o );
        Field age = aClass.getDeclaredField( "age" );
        age.setAccessible( true );
        age.set( o, 25 );
        Object o1 = age.get( o );
        System.out.println("name:"+o2+"\r\n"+"age:"+o1);
    }
}
